import 人事管理系统.Connect.*;
import 人事管理系统.GUI.Index;
import 人事管理系统.GUI.Login;
import 人事管理系统.Tables.*;

import java.sql.SQLException;
import java.util.ArrayList;

public class test {

    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        new Index();

        /*
        //测试管理员账号
        Accounts_Database as=new Accounts_Database();
        as.setUserName("admin");
        as.setUserPassword("admin");
        as.checkAccout();
         */

        /*
        //测试员工数据查询
        Employee_Database e=new Employee_Database();
        ArrayList<Employee> list=new ArrayList<>();
        list=e.findAll();
        for(Employee employee:list){
            System.out.println(employee);
        }
         */

        /*
        //条件查询，根据Eno查询商品信息
        Employee_Database e=new Employee_Database();
        Employee employee=new Employee();
        employee=e.findByEno("202001");
        System.out.println(employee);
         */

        /*
        //插入一条信息
        Employee_Database e=new Employee_Database();
        Employee employee=new Employee("202005","王益","male","小学","d003","员工");
        int result=e.insert(employee);
        if(result!=0){
            System.out.println("添加成功！");
        }else{
            System.out.println("添加失败！");
        }
         */

        /*
        //删除一条员工信息
        Employee_Database e=new Employee_Database();
        int result=e.delete("202005");
        if(result!=0){
            System.out.println("删除成功！");
        }else{
            System.out.println("删除失败！");
        }
         */
/****************************************************************/
        /*
        //测试部门数据查询
        Department_Database d=new Department_Database();
        ArrayList<Department> list=new ArrayList<>();
        list=d.findAll();
        for(Department department:list){
            System.out.println(department);
        }

         */

        /*
        //条件查询，根据Dno查询部门信息
        Department_Database e=new Department_Database();
        Department department=new Department();
        department=e.findByDno("d003");
        System.out.println(department);

         */

        /*
        //插入一条部门信息
        Department_Database e=new Department_Database();
        Department department=new Department("d005","经管部","陈七");
        int result=e.insert(department);
        if(result!=0){
            System.out.println("添加成功！");
        }else{
            System.out.println("添加失败！");
        }

         */

        /*
        //删除一条部门信息
        Department_Database e=new Department_Database();
        int result=e.delete("d005");
        if(result!=0){
            System.out.println("删除成功！");
        }else{
            System.out.println("删除失败！");
        }

         */

/****************************************************************/

        /*
        //测试工资数据查询
        Salary_Database salary=new Salary_Database();
        ArrayList<Salaryinfo> list=new ArrayList<>();
        list=salary.findAll();
        for(Salaryinfo sa:list){
            System.out.println(sa);
        }

         */
/****************************************************************/
        /*
        //测试管理员对部门操作记录查询
        Opdep_database opd=new Opdep_database();
        ArrayList<Opdep> list=new ArrayList<>();
        list=opd.findAll();
        for(Opdep op:list){
            System.out.println(op);
        }

         */
/****************************************************************/
        /*
        //测试管理员对员工操作记录查询
        Opemp_Database opd=new Opemp_Database();
        ArrayList<Opemp> list=new ArrayList<>();
        list=opd.findAll();
        for(Opemp op:list){
            System.out.println(op);
        }

         */
/****************************************************************/
        /*
        //测试员工调动表的查看
        Change_Database opd=new Change_Database();
        ArrayList<Changeemp> list=new ArrayList<>();
        list=opd.findAll();
        for(Changeemp cmp:list){
            System.out.println(cmp);
        }

         */

        /*
        //插入一条调动信息
        Change_Database e=new Change_Database();
        Changeemp changeemp=new Changeemp("T016","202005","","太老了，退休");
        int result=e.insert(changeemp);
        if(result!=0){
            System.out.println("添加成功！");
        }else{
            System.out.println("添加失败！");
        }

         */













    }
}
